home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / dlibs12 / fopenp.c < prev    next >
C/C++ Source or Header  |  1990-11-23  |  335b  |  18 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. FILE *fopenp(filename, mode)
  5.     char *filename;
  6.     char *mode;
  7.     {
  8.     register FILE *fp = NULL;
  9.     char fn[128], *pfindfile();
  10.  
  11.     strcpy(fn, filename);
  12.     if(strchr(fn, '.') == NULL)
  13.         strcat(fn, ".");
  14.     if(filename = pfindfile(NULL, fn, "\0"))
  15.         fp = fopen(filename, mode);
  16.     return(fp);
  17.     }
  18.